package org.hawk.gwtppc.webtest.tests.classsuite;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.AnnotationMock;
import org.hawk.gwtppc.webtest.tests.mock.ClassMock;
import org.hawk.gwtppc.webtest.tests.mock.EnumMock;
import org.hawk.gwtppc.webtest.tests.mock.InterfaceMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock1;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class IsInstanceTest implements Test {

	public void run() throws Throwable {
		SubClassMock1 mock = new SubClassMock1();
		Asserts.assertTrue(SubClassMock1.class.isInstance(mock));
		Asserts.assertFalse(SubClassMock2.class.isInstance(mock));
		Asserts.assertTrue(ClassMock.class.isInstance(mock));
		Asserts.assertTrue(Object.class.isInstance(mock));
		Asserts.assertFalse(AnnotationMock.class.isInstance(mock));
		Asserts.assertTrue(EnumMock.class.isInstance(EnumMock.ALPHA));
		Asserts.assertTrue(InterfaceMock.class.isInstance(mock));
		Asserts.assertFalse(InterfaceMock.class.isInstance(EnumMock.ALPHA));
	}

	public String getName() {
		return "isInstance(Object)";
	}

}
